﻿Imports System.Data.SqlClient
Imports Microsoft.Reporting.WinForms
Public Class saleGraphicChart
    Dim cmd As New SqlCommand
    Private Sub saleGraphicChart_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        condb()
        cmd.Connection = cn
        cmd.CommandText = "select proname,SUM (Qty) total from tblorder o inner join tblorderDetial od ON o.InvoiceID = od.InvoiceID where o.orderDate between '" & Selereport.startdate.Value & "' and '" & Selereport.enddate.Value & "' group by ProName"
        Dim dr = cmd.ExecuteReader
        Dim dt As New DataTable
        dt.Load(dr)
        dr.Close()
        Me.ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("DataSet1", dt))
        Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "stock.SaleReport.rdlc"
        Me.ReportViewer1.SetDisplayMode(DisplayMode.PrintLayout)
        Me.ReportViewer1.ZoomMode = ZoomMode.FullPage
        Me.ReportViewer1.RefreshReport()
        Me.ReportViewer1.RefreshReport()
    End Sub
End Class